
using SageKing.Designer.Core.UI.Contracts;
using SageKing.Designer.Core.UI.Models;
using JetBrains.Annotations;
using MudBlazor;
using SageKing.Studio;

namespace SageKing.Designer.Core.UI.Providers;

/// Provides default activity display settings.
[UsedImplicitly]
public class DefaultActivityDisplaySettingsProvider : IActivityDisplaySettingsProvider
{
    /// <param name="activityDescriptor"></param>
    /// <inheritdoc />
    public IDictionary<string, ActivityDisplaySettings> GetSettings() => new Dictionary<string, ActivityDisplaySettings>
    {
        // Not Found Activity
        ["SageKing.NotFoundActivity"] = new(DefaultActivityColors.NotFound, SageKingStudioIcons.Heroicons.Exclamation),
        
        // Branching
        ["SageKing.If"] = new(DefaultActivityColors.Branching, SageKingStudioIcons.Heroicons.Question),
        ["SageKing.FlowDecision"] = new(DefaultActivityColors.Branching, SageKingStudioIcons.Heroicons.Question),
        ["SageKing.Switch"] = new(DefaultActivityColors.Branching, SageKingStudioIcons.Tabler.SwitchDiagonal),
        ["SageKing.FlowSwitch"] = new(DefaultActivityColors.Branching, SageKingStudioIcons.Tabler.SwitchDiagonal),
        ["SageKing.FlowJoin"] = new(DefaultActivityColors.Branching, SageKingStudioIcons.Tabler.GitMerge),
        ["SageKing.FlowFork"] = new(DefaultActivityColors.Branching, SageKingStudioIcons.Tabler.GitFork),
        
        // Composition
        ["SageKing.Complete"] = new(DefaultActivityColors.Composition, SageKingStudioIcons.Tabler.CheckCircle),
        ["SageKing.SetOutput"] = new (DefaultActivityColors.Composition),
        ["SageKing.DispatchWorkflow"] = new (DefaultActivityColors.Composition),
        ["SageKing.BulkDispatchWorkflows"] = new (DefaultActivityColors.Composition),
        
        // Console
        ["SageKing.WriteLine"] = new(DefaultActivityColors.Console, SageKingStudioIcons.Tabler.Pencil),
        ["SageKing.ReadLine"] = new(DefaultActivityColors.Console, SageKingStudioIcons.Tabler.Text),
        
        // Email
        ["SageKing.SendEmail"] = new(DefaultActivityColors.Email, Icons.Material.Outlined.Email),
        
        // Flowchart
        ["SageKing.Flowchart"] = new(DefaultActivityColors.Flowchart, SageKingStudioIcons.Tabler.GitFork),
        ["SageKing.FlowNode"] = new(DefaultActivityColors.Flowchart, SageKingStudioIcons.Tabler.Hexagon),
        ["SageKing.Start"] = new(DefaultActivityColors.Flowchart, Icons.Material.Outlined.Start),
        ["SageKing.End"] = new(DefaultActivityColors.Flowchart, Icons.Material.Outlined.OutlinedFlag),
        
        // HTTP
        ["SageKing.HttpEndpoint"] = new(DefaultActivityColors.Http, SageKingStudioIcons.Tabler.Cloud),
        ["SageKing.WriteHttpResponse"] = new(DefaultActivityColors.Http, SageKingStudioIcons.Heroicons.PencilPaper),
        ["SageKing.WriteFileHttpResponse"] = new(DefaultActivityColors.Http, Icons.Material.Outlined.FileDownload),
        ["SageKing.SendHttpRequest"] = new(DefaultActivityColors.Http, SageKingStudioIcons.Tabler.World),
        ["SageKing.FlowSendHttpRequest"] = new(DefaultActivityColors.Http, SageKingStudioIcons.Tabler.World),
        ["SageKing.DownloadHttpFile"] = new(DefaultActivityColors.Http, @Icons.Material.Outlined.CloudDownload),
        
        // Looping
        ["SageKing.While"] = new(DefaultActivityColors.Looping, SageKingStudioIcons.Tabler.RepeatOne),
        ["SageKing.ForEach"] = new(DefaultActivityColors.Looping, SageKingStudioIcons.Tabler.RepeatOne),
        ["SageKing.For"] = new(DefaultActivityColors.Looping, SageKingStudioIcons.Tabler.RepeatOne),
        ["SageKing.Break"] = new(DefaultActivityColors.Looping, SageKingStudioIcons.Tabler.Back1),
        
        // Primitives
        ["SageKing.SetVariable"] = new(DefaultActivityColors.Primitives, SageKingStudioIcons.Tabler.Pencil),
        ["SageKing.SetName"] = new(DefaultActivityColors.Primitives, SageKingStudioIcons.Tabler.Italic),
        ["SageKing.Finish"] = new(DefaultActivityColors.Primitives, SageKingStudioIcons.Tabler.CheckShield),
        ["SageKing.Fault"] = new(DefaultActivityColors.Primitives, Icons.Material.Outlined.ErrorOutline),
        ["SageKing.Correlate"] = new(DefaultActivityColors.Primitives, Icons.Material.Outlined.DatasetLinked),
        ["SageKing.RunTask"] = new(DefaultActivityColors.Primitives, Icons.Material.Outlined.Settings),
        ["SageKing.PublishEvent"] = new(DefaultActivityColors.Primitives, Icons.Material.Outlined.FlashOn),
        ["SageKing.Event"] = new(DefaultActivityColors.Primitives, Icons.Material.Outlined.FlashOn),
        
        // Timers
        ["SageKing.Timer"] = new(DefaultActivityColors.Timer, Icons.Material.Outlined.Timer),
        ["SageKing.Cron"] = new(DefaultActivityColors.Timer, Icons.Material.Outlined.Timer),
        ["SageKing.Delay"] = new(DefaultActivityColors.Timer, Icons.Material.Outlined.RotateLeft),
        ["SageKing.StartAt"] = new(DefaultActivityColors.Timer, Icons.Material.Outlined.CalendarMonth),
        
        // Scripting
        ["SageKing.RunJavaScript"] = new(DefaultActivityColors.Scripting, Icons.Material.Outlined.Javascript),

        // Azure Service Bus
        ["SageKing.AzureServiceBus.MessageReceived"] = new("#a21caf", SageKingStudioIcons.Heroicons.Incoming),
        ["SageKing.AzureServiceBus.SendMessage"] = new("#a21caf", SageKingStudioIcons.Heroicons.Outgoing),
    };
}